home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir27 / cf427.zip / CF427.DOC < prev    next >
Text File  |  1994-02-06  |  16KB  |  337 lines

  1. February 6 1994                  (C) Copyright, 1994  John P Arkins
  2.  
  3.                           CurveFits v4.27
  4.                           ---------------
  5.  
  6.  DISCLAIMER:  Although effort has been taken to insure accurate
  7.               answers are obtained when using this program, the
  8.               USER assumes all risks when using this program.
  9.               Good practice dictates that sample data should be
  10.               used to determine the validity of calculations
  11.               performed by this program.  If you are not willing
  12.               to assume all risks when using this program then
  13.               do not use it.      
  14.  
  15.  
  16. HISTORY
  17. -------
  18. CF101  -- January,1992 (Never Released)
  19. CF251  -- August,1992
  20. CF315  -- January,1993
  21. CF427  -- February,1994
  22.  
  23. USING THE PROGRAM
  24. -----------------
  25.  
  26. MAIN MENU
  27. ---------
  28. The main menu has 6 selections :
  29.  
  30.  (1) Create New Data File
  31.  (2) Load/Erase Data File
  32.  (3) Edit Data File
  33.  (4) Curve Fit Menu
  34.  (5) Exit Program
  35.  (6) Change Configuration
  36.  
  37. Options 3 and 4 cannot be executed without a data file being currently
  38. loaded in memory.  A file can be loaded into memory be either creating it
  39. (option 1) or loading it from a file on disk(option 2).
  40.  
  41. CREATE DATA FILE
  42. ----------------
  43. Enter the x and y data making sure to press enter after each.  When
  44. finished enter a blank for the y value.  This is not the only way
  45. to place data in a data file.  Read CF&XY.DOC for more info.
  46. Note: It is good practice to reduce the magnitude of the base 10
  47. logarithm of the numbers you enter into this program, for it will
  48. ensure more accurate calculations.  For example, suppose one pair of
  49. data is 5000000 P , 600000 L (where P and L represent some form of
  50. units, Newtons,Coulombs etc.).  It is better to enter the data as
  51. 5 MP (Mega P's) , 600 KL (Kilo L's).  Just realize that the fitted
  52. equation will be a function of MP and will output it's results in KL 's
  53. The same is true for small numbers where 1e-6 P is 1 µP (1 Micro-P) etc.
  54. Although the program accepts data pairs with repeated x values, realize
  55. that a data file with much of it's data at the same x coordinate WILL
  56. cause a run-time error and cause the program to abort.  This is because
  57. it is trying to invert a matrix whose determinant is zero or very near
  58. zero.
  59.  
  60. LOAD/ERASE DATA FILE
  61. --------------------
  62. On this screen you can load or erase data (.DAT) files which are located
  63. in the same directory as CF427.EXE. Simply scroll through the listing of
  64. files with the up/down cursor keys.  If you press enter the highlighted
  65. file will be loaded into memory and you will return to the main menu.  If
  66. you press Alt-D the highlighted file will be deleted and you will return
  67. to the main menu.  Note: The page down and page up keys perform the same
  68. action as the cursor up and cursor down keys except that they move the
  69. highlight bar 10 positions instead of one.
  70.  
  71. EDIT DATA FILE
  72. --------------
  73. Selecting this option will allow you to edit your data file.  To delete a
  74. data pair press delete.  You will then be asked for the number of the data
  75. pair you wish to delete. Type in the appropriate number and then press
  76. enter.  The data pair has now been deleted.  To edit a data pair press
  77. enter.  You will then be asked for the number of the data pair you wish
  78. to edit.  Enter the appropriate number and press enter.  You will then be
  79. prompted to enter the new x and y values.  Press enter after you enter each
  80. number.  Pressing enter without entering a number will result in a zero
  81. and not the old value for that coordinate.  The cursor keys and the PgDn
  82. and PgUp keys will perform the same actions as they do on the Load/Erase
  83. data file screen.
  84.  
  85. CURVE FIT MENU
  86. --------------
  87. When the user selects this option he/she will see a flashing message
  88. saying 'Calculating Data...'.  At this point CurveFits is now determining
  89. which fits are applicable to your data, and performing them.  The time
  90. required for this will increase with an increase in data points.  After
  91. this the curve fit menu will appear.  Non-applicable fits will appear in
  92. red text and will be unselectable.  Use cursor keys to move the highlight
  93. bar across and/or down to the fit you wish to perform.  When the desired fit
  94. is highlighted press enter.  The fit with the best correlation coefficient
  95. will be marked with an R.  The fit with the lowest standard error will be
  96. marked with a sigma.  Selecting the best fit - standard error or
  97. best fit - correlation coefficient will list the top 20 fits from best down
  98. to worst.  Since the equation for the correlation coefficient mentioned below
  99. sometimes provides a correlation greater than one, fits with values greater
  100. than one will be assigned a value of zero for this sort.  CurveFits presently
  101. supports 26 types of fits, 18 of which are more or less 'distinct'.  The
  102. fits which are similar or in some cases identical are:
  103.  
  104.   Linear, Quadratic and Polynomial Fits
  105.   Exponential and Modified Power Fit
  106.   Root, Modified Hoerl and Modified Exponential Fit
  107.   Cauchy and Reciprocal Quadratic Fit
  108.   Inverse and Hyperbolic Fit
  109.   Reciprocal line and Reciprocal Quadratic Fits
  110.  
  111. For some fits the LN or the inverse of input data is used in the program's
  112. calculations.  For this reason these fits cannot support data containing
  113. zeros and negatives or data containing zeros respectively.  Other fits
  114. will also may not be available if during the curve fitting calculations
  115. their coefficients are determined to have values which will cause infinite
  116. or undefined results, such as c = 0 for the Gaussian Fit.  When a fit is
  117. unavailable it will appear in red text on the curve fitting menu screen.
  118.  
  119. The 26 Fits and limitations are:
  120.  
  121.    Name                    Equation             Limitations
  122. ----------------------------------------------------------------------------
  123.  1 Linear                : Y=A+B*X
  124.  2 Quadratic             : Y=A+B*X+C*X^2
  125.  3 Power                 : Y=A*X^B              X and Y greater than zero
  126.  4 Exponential           : Y=A*EXP(B*X)         X greater than zero
  127.  5 Logarithm             : Y=A+B*LN(X)          X greater than zero
  128.  6 Hyperbolic            : Y=A+B/X              Non-zero X
  129.  7 Super Geometric       : Y=A*X^(B*X)          X and Y greater than zero
  130.  8 Root                  : Y=A*B^(1/X)          Non-zero X and Y > 0
  131.  9 Polynomial            : Y=A+B*X+C*X^2        Will not accept repeated
  132.                                                 X Values for divided diff.
  133. 10 Reciprocal Line       : Y=1/(A+B*X)          Non-zero Y
  134. 11 Reciprocal Quadratic  : Y=1/(A+B*X+C*X^2)    Non-zero Y
  135. 12 Modified Power        : Y=A*B^X              Y greater than zero
  136. 13 Modified Exponential  : Y=A*EXP(B/X)         Non-zero X and Y > 0
  137. 14 Reciprocal Logarithm  : Y=1/(A+B*LN(X))      Non-zero Y and Y > 0
  138. 15 Reciprocal Hyperbolic : Y=X/(A+B*X)          Non-zero X and Y
  139. 16 Modified Geometric    : Y=A*X^(B*X)          X and Y greater than zero
  140. 17 Heat Capacity         : Y=A+B*X+C/X^2        Non-zero X
  141. 18 Vapor Pressure        : Y=EXP(A+B/X+C*LN(X)) Non-zero X and Y > 0
  142. 19 Exponential Step      : Y=A*(1-B*EXP(-X))
  143. 20 Sinusoidal            : Y=A+B*SIN(X+C)
  144. 21 Gaussian              : Y=A*EXP(-(X-B)^2/(2*C^2))
  145.                                                 Y greater than zero
  146. 22 Inverse               : Y=A+B/X+C/X^2        Non-zero X
  147. 23 Hoerl                 : Y=A*B^X*X^C          X and Y greater than zero
  148. 24 Cauchy                : Y=1/(A*(X+B)^2+C)    Non-zero Y
  149. 25 Modified Hoerl        : Y=A*B^(1/X)*X^C      X and Y greater than zero
  150. 26 Log Normal            : Y=A*EXP((LN(X)-B)^2/C)
  151.                                                 X and Y greater than zero
  152. ----------------------------------------------------------------------------
  153.  
  154.  
  155. POLYNOMIAL FIT
  156. --------------
  157.  This fit requires at least four data points.  If there are less than four
  158. data points it will be unselectable and will appear in red text on the curve
  159. fits menu screen.  When this fit is chosen the user is prompted for the order of the fit
  160. desired, the order referring to the number of coefficients in the desired
  161. polynomial fit.  If there are more than twenty data points the user will be
  162. be asked for a value between four to twenty, if there are less than twenty
  163. data points, say seventeen, the user will be asked for a value between four
  164. and seventeen.  If the order chosen is equal to the number of data points,
  165. the user will then be given the option of doing the fit using either
  166. Newton's forward divided difference or by the usual matrix method. Newton's
  167. forward divided difference is more accurate than the matrix method however
  168. it cannot accept repeated x values and it's order is not adjustable as is
  169. the case with the matrix method.  To exit the polynomial fit screen the user
  170. must press enter without entering a value.  If you are using the matrix
  171. manipulation option and receive a correlation coefficient greater than 1,
  172. reduce the order of the fit for better results.
  173.  
  174. GRAPH-SCREEN
  175. ------------
  176. When the graph screen is active, these keys perform the described actions:
  177.  
  178. DESCRIPTION OF HOTKEYS:
  179. -----------------------
  180.    When the graphing screen is active these hot-keys support
  181.    the described actions:
  182.  
  183.        F1 -- TOGGLE GRID
  184.              Pressing this key will turn the 'grid' on or off. If the grid
  185.              is 'on' a message will be displayed on the bottom right hand
  186.              corner of the screen.  The grid may not be on the screen at
  187.              first, if this is true you must reduce the x and y grid spacing
  188.              by pressing < and , keys respectively.  If the grid spacing
  189.              is too small the grid will not be displayed, and a message
  190.              will be displayed on the bottom right hand corner of the
  191.              screen.
  192.        F2 -- TOGGLE GRID LABELING
  193.              Pressing this key will toggle labeling of the grid.  If the
  194.              grid is too dense it will not be labeled.
  195.        F3 -- TOGGLES CIRCLING OF DATA POINTS
  196.              This key will toggles the circling of the input data points.
  197.        F4 -- TOGGLES ZOOM WINDOW
  198.              This key will turn on/off the zoom window which graphically
  199.              highlights the area which will be seen if Shft-Z is pressed.
  200.        F5 -- TOGGLES TITLING OF GRAPH
  201.              This key will turn on/off all text display on the graph screen.
  202.        F6 -- TOGGLES LINE THICKNESS
  203.        F7 -- TOGGLES GRAPHING ALONG X RANGE(Polynomial Only)
  204.              If on, the curve will only be graphed from the lowest x value
  205.              to the largest x value.
  206.        F8 -- TOGGLES XSCALE = YSCALE
  207.              If on, the x and y axes will have the same scale(EGA,VGA)
  208.        F9 -- CHANGES LINE COLOR
  209. (   ) -- MOVE VIEWPOINT OF GRAPH (CURSOR KEYS)
  210.              The cursor keys move the viewpoint area on the graph.
  211.     (+ -) -- INCREASES/DECREASES CALCULATION STEP SIZE (PLUS/MINUS KEYS)
  212.              These keys will double/halve the calculation step size of the
  213.              graphed curve.
  214.     ([ ]) -- ADJUST CURSOR MOVEMENT ( SQUARE BRACKET KEYS )
  215.              Will increase/decrease the distance moved when the cursor
  216.              keys are pressed.
  217.              (If NUMLOCK is on, the numeric keypad's arrows will move
  218.              1/3 the distance of the cursor keys)
  219.     (, .) -- ADJUSTS X GRID SPACING (COMMA AND PERIOD KEYS)
  220.          (,) Decreases X grid spacing by a factor of ten
  221.          (.) Increases X grid spacing by a factor of ten
  222.     (< >) -- ADJUSTS Y GRID SPACING (LESS THAN/GREATER THAN KEYS)
  223.              Analogous to the above.
  224.       (/) -- TOGGLES DIVISION OF X GRID SPACING BY 2  (BACK-SLASH KEY)
  225.       (?) -- TOGGLES DIVISION OF Y GRID SPACING BY 2  (QUESTION MARK KEY)
  226.       (C) -- COEFFICIENTS OF EQUATIONS
  227.              Will display the coefficients of the fitted equations
  228.              using scientific notation with 18 significant figures.
  229.       (D) -- DATA COMPARISON
  230.              Will display a comparison between the original data
  231.              an the calculated values.  The arrow keys will allow
  232.              the user to scroll up and down through the data.
  233.  (Shft-P) -- CREATE DOS TEXT FILE
  234.              Creates DOS text file containing Equation type,
  235.              coefficients, input data, data from fitted equation
  236.              and the standard error, maximum error and correlation
  237.              coefficient.
  238.  (Shft-L) -- OUTPUT TO HP LASERJET COMPATIBLE PRINTER
  239.              Printing can be aborted at any time by pressing the ESC 
  240.              key.  Works with printers attached to the Comm ports if the         
  241.              appropriate MODE command has been issued at the DOS prompt. 
  242.              Output resolution is limited to that of the display adapter 
  243.              in use.
  244.       (F) -- TOGGLES FULLSCALE DISPLAY (POLYNOMIAL FIT ONLY)
  245.              This will show the entire curve within the x data range
  246.              on the screen.
  247.       (R) -- RESETS GRAPH SETTINGS
  248.              Resets zoom and grid parameters and centers plot.
  249.       (V) -- CALCULATE VALUE FROM EQUATION
  250.              Allows user to calculate a value using the fitted equation
  251.       (X) -- EXPANDS X RANGE
  252.              Increases the scale of the x axis without altering the
  253.              scaling of the y axis.
  254.  (Shft X) -- DECREASES X RANGE
  255.       (Y) -- EXPANDS Y RANGE
  256.  (Shft Y) -- DECREASES Y RANGE
  257.       (Z) -- ZOOM IN
  258.  (Shft Z) -- ZOOM OUT
  259.  
  260.  
  261. EXIT PROGRAM
  262. ------------
  263. The user can exit the program by selecting this option or by pressing the
  264. ESC key.  The ESC key will cause an exit from most screens within the
  265. program.
  266.  
  267. CHANGE CONFIGURATION
  268. --------------------
  269.   This option allows for the changing of the default settings of CurveFits
  270. graphing screen, whether the grid is initially on or off etc.  It also allows
  271. for the changing of the colors used on the graphing screen. If for some
  272. reason you want all the original settings back, merely delete the file
  273. CF427.CFG.  When CurveFits looks for this file and cannot find it it will
  274. automatically create a new one with the original settings.
  275.  
  276.  
  277. MISCELLANEOUS NOTES:
  278. --------------------
  279. COMPUTATIONS:
  280. -------------
  281.  
  282. Standard Error:
  283.  The standard error is calculated as follows:
  284.  
  285. StErr := SQRT(SumErrSqr/(N-2))
  286.  
  287. Correlation Coefficient:
  288. ------------------------
  289. R:=SQRT(1-SumErrSqr/(SumY2-SQR(SumY*SumY)/N))
  290.  
  291. where:
  292.  
  293. SumErrSq is the sum of the sum of the squared difference between
  294.          the calculated values and actual data.
  295.    SumY2 is the sum of the squares of the Y data
  296.        N is the number of data points
  297.     SumY is the sum of the Y data
  298.  
  299.  This formula will sometimes return a correlation greater than one.  This
  300. is usually indicative of a poor fit.
  301.  
  302. COMMAND LINE PARAMETERS
  303. -----------------------
  304.  If you already have a data file you want to run the CurveFits program on,
  305. you can specify it from the command line.  For example, when you are within
  306. the directory CurveFits is contained in, type CF427 LINEAR to run the
  307. CurveFits program on a file called LINEAR.DAT.  Notice that you omit the
  308. file extension.  This process will skip the opening screen and the main menu
  309. and take you directly to the curve fitting menu.
  310.  
  311. PROGRAM
  312. -------
  313. CF427 uses Turbo Pascal's extended real data type.  This data type allows
  314. for 18-19 digit accuracy in computations.  However, this data type requires
  315. a math coprocessor.  If no coprocessor is detected on your computer the
  316. program will use it's own software emulation of a math coprocessor.
  317. This emulation utilizes the main CPU however and will slow down the
  318. program's performance considerably.  The program runs at an acceptable
  319. speed on my computer which is an 80386-20MHz with a 80387 math coprocessor.
  320.  
  321. SHAREWARE NOTICE:
  322. -----------------
  323. The program Curvefits v4.27 and this text file are not in the public
  324. domain, they are shareware.  Please register your copy by sending $25
  325. to the below address.
  326.  
  327.                          John P Arkins
  328.                          54 Pearl Street
  329.                          NHP, NY 11040
  330.  
  331.  Any questions or suggestions can also be sent to the author by E-mail to:
  332.  
  333.                 CID : 73633,3417
  334.            Internet : 73633.3417@CompuServe.Com
  335.  
  336.  
  337.